<%@page import="com.xnx3.j2ee.Global"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>  
<jsp:include page="/wm/common/head.jsp">
	<jsp:param name="title" value="编辑"/>
</jsp:include>

<form class="layui-form" style="padding-top:35px; margin-bottom: 10px; padding-right:35px;">
	<input type="hidden" name="goodsid" value="${id }" />
	
	<div class="layui-form-item">
		<label class="layui-form-label">最小价格</label>
		<div class="layui-input-block">
			<input type="number" name="minPrice" class="layui-input" value="${minPrice/100}">
		</div>
		<div class="explain" style="font-size: 12px;color: gray;padding-top: 3px;padding-left: 110px;">
			商品的最小价格单位：元
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">最大价格</label>
		<div class="layui-input-block">
			<input type="number" name="maxPrice" class="layui-input" value="${maxPrice/100}">
		</div>
		<div class="explain" style="font-size: 12px;color: gray;padding-top: 3px;padding-left: 110px;">
			商品的最大价格单位：元
		</div>
	</div>
	
   	<div class="layui-form-item" style="padding-top:15px;">
		<div class="layui-input-block">
			<button class="layui-btn" lay-submit="" lay-filter="demo1">保存</button>
		</div>
	</div>
</form>

<script>
//自适应弹出层大小
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
//parent.layer.iframeAuto(index);

layui.use(['form', 'layedit', 'laydate'], function(){
	var form = layui.form;

	//监听提交
	form.on('submit(demo1)', function(data){
		parent.parent.msg.loading("保存中");
		var postDate = wm.getJsonObjectByForm($("form"));	//提交的表单数据
		wm.post('save.json', postDate, function (obj) { 
			parent.parent.msg.close();
			if(obj.result == '1'){
				parent.parent.msg.success("操作成功")
				parent.layer.close(index);
				parent.location.reload();	//刷新父窗口
			}else if(obj.result == '0'){
				parent.parent.msg.failure(obj.info);
			}else{
				parent.parent.msg.failure(result);
			}
		});
	    
		return false;
	});
});
</script>

<jsp:include page="/wm/common/foot.jsp"></jsp:include> 